package com.common.tools.model;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author lxw
 */
@Data
@AllArgsConstructor
public class Result<T> {
    private T data;
    private Integer code;
    private String msg;

    public static <T> Result<T> success(T data) {
        return new Result<>(data, 1, "成功");
    }

    public static <T> Result<T> fail(String msg) {
        return new Result<>(null, 0, msg);
    }
}
